package cn.iocoder.yudao.module.wengfu.dal.mysql.consignmentprocessingreport;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.wengfu.dal.dataobject.consignmentprocessingreport.ConsignmentProcessingReportDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.wengfu.controller.admin.consignmentprocessingreport.vo.*;

/**
 * 委托加工及购进矿石质量报表 Mapper
 *
 * @author yzs
 */
@Mapper
public interface ConsignmentProcessingReportMapper extends BaseMapperX<ConsignmentProcessingReportDO> {

    default PageResult<ConsignmentProcessingReportDO> selectPage(ConsignmentProcessingReportPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ConsignmentProcessingReportDO>()
                .eqIfPresent(ConsignmentProcessingReportDO::getSerialNumber, reqVO.getSerialNumber())
                .likeIfPresent(ConsignmentProcessingReportDO::getProductName, reqVO.getProductName())
                .eqIfPresent(ConsignmentProcessingReportDO::getMonthlyAverage, reqVO.getMonthlyAverage())
                .eqIfPresent(ConsignmentProcessingReportDO::getMonthlyQuantity, reqVO.getMonthlyQuantity())
                .eqIfPresent(ConsignmentProcessingReportDO::getYearlyCumulativeAverage, reqVO.getYearlyCumulativeAverage())
                .eqIfPresent(ConsignmentProcessingReportDO::getYearlyCumulativeQuantity, reqVO.getYearlyCumulativeQuantity())
                .eqIfPresent(ConsignmentProcessingReportDO::getLastYearCumulativeAverage, reqVO.getLastYearCumulativeAverage())
                .eqIfPresent(ConsignmentProcessingReportDO::getLastYearCumulativeQuantity, reqVO.getLastYearCumulativeQuantity())
                .betweenIfPresent(ConsignmentProcessingReportDO::getCreateTime, reqVO.getCreateTime())
                .orderByAsc(ConsignmentProcessingReportDO::getId));
    }

    int deleteAll();


}
